/// @author: cairuoyu
/// @homepage: http://cairuoyu.com
/// @github: https://github.com/cairuoyu/cry、https://github.com/cairuoyu/flutter_admin
/// @date: 2021/6/21
/// @version: 1.0
/// @description:

import 'package:flutter/material.dart';
import 'package:flutter_admin/pages/common/cry/generated/l10n.dart';

import 'cry_button.dart';

class CryButtons {
  // CryButtons._();

  static add(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? S.of(context).add : null,
      iconData: Icons.add,
      onPressed: onPressed);

  static delete(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? S.of(context).delete : null,
      iconData: Icons.delete,
      onPressed: onPressed);

  static edit(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? S.of(context).edit : null,
      iconData: Icons.edit,
      onPressed: onPressed);

  static retum(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? "归还" : null,
      iconData: Icons.edit,
      onPressed: onPressed);

  static lend(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? "借阅" : null,
      iconData: Icons.edit,
      onPressed: onPressed);

  static dmsFile(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? "电子文档" : null,
      iconData: Icons.view_agenda_rounded,
      onPressed: onPressed);

  static query(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? S.of(context).query : null,
      iconData: Icons.search,
      onPressed: onPressed);

  static reset(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? S.of(context).reset : null,
      iconData: Icons.refresh,
      onPressed: onPressed);

  static save(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? S.of(context).save : null,
      iconData: Icons.save,
      onPressed: onPressed);

  static cancel(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? S.of(context).cancel : null,
      iconData: Icons.cancel,
      onPressed: onPressed);

  static commit(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? S.of(context).commit : null,
      iconData: Icons.done,
      onPressed: onPressed);

  static download(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? '下载' : null,
      iconData: Icons.download_rounded,
      onPressed: onPressed);

  static print(context, onPressed, {showLabel: true}) => CryButton(
      label: showLabel ? '打印' : null,
      iconData: Icons.print_rounded,
      onPressed: onPressed);
}
